package com.chen.dao;

import com.chen.entity.Users;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

@Repository
public interface UsersDao extends JpaRepository<Users, String>, JpaSpecificationExecutor<Users> {

	@Modifying
	@Transactional
	@Query("delete from Users s where s.id in (?1)")
	void deleteBatch(List<String> ids);
}